package com.yzd.learnjava.holding;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;

import com.yzd.learnjava.util.Print;
/*
 * Arrays.asList()
 */
public class ModifingArraysAsList {

	public static void main(String[] args) {
		Random random = new Random(47);
		
		Integer[] ia = {1,2,3,4,5,6,7,8,9,10};
		List<Integer> list1 = new ArrayList<Integer>(Arrays.asList(ia));
		
		Print.print("before shuffled:" + list1);
		Collections.shuffle(list1);
		Print.print("After shuffled : " + list1);
		
		Print.print("Array:" + Arrays.toString(ia));
		
		
		List<Integer> list2 = Arrays.asList(ia);
		Print.print("before shuffled:" + list2);
		Collections.shuffle(list2, random);
		Print.print("After shuffled : " + list2);
		Print.print("Array:" + Arrays.toString(ia));
		
		
	}

}
